home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hobby PC 32
/
Hobby PC 32.iso
/
extras
/
WIN31
/
DATA.Z
/
DC3LOCAL.INC
< prev
next >
Wrap
Text File
|
1995-12-04
|
19KB
|
576 lines
'----------------------------------------------------------------
'- more specialized little functions to make our lives easier.
'- John Alspaugh 10OCT94
'- Copyright 1993-1995 Virtus Corporation. All Rights Reserved.
'-
'- Note that this must be included after MSDETECT.INC and SETUPAPI.INC
'-
'----------------------------------------------------------------
'-------------------------------------------------------------------
'' VL_* functions are those with local variable references.
'' V* functions can stand alone.
'-------------------------------------------------------------------
'' define one of these: PROGRAM or LIBRARY. It defines the dialog
'' IDs and stuff.
'$DEFINE PROGRAM
'$ifdef PROGRAM
'$DEFINE OPTION ''if OPTION, then give the user the choice of a custom install.
''''$DEFINE SERIAL ''no serial, no work.
''''$DEFINE CHATTER '' turns on the little blurby messages during the install
'''$ELSE IF LIBRARY
'$endif 'PROGRAM
'*******************************************************************
' consts for dialogs
CONST MODWININI_DLG = 7600
'*******************************************************************
' declare all the functions up front.
DECLARE SUB VL_Initialize
DECLARE SUB VL_InitDiskCosts
DECLARE SUB VL_RecalcOptFiles (ftype%)
DECLARE FUNCTION VL_DoCheckItems(pItem$) AS INTEGER
DECLARE FUNCTION VL_CalcDiskCost(pDrive$) AS LONG
DECLARE SUB VL_SetupBillboards
DECLARE SUB VL_InitDirNames
DECLARE SUB VL_RecalcPath
DECLARE SUB VL_AddOptFilesToCopyList (ftype%)
DECLARE SUB VL_DoTheInstall
DECLARE SUB VL_MakeTheAppIcons
DECLARE SUB VL_ShowIconsOkay
DECLARE FUNCTION VL_ShouldWeSerialize AS INTEGER
DECLARE SUB VL_InitReadmeFileNames
DECLARE SUB VL_MakeTheReadmeIcons
'*******************************************************************
' these are the global variable things. They get used in lots of
' areas
'' there should be one I* const for each checkbox in dialog #6200
CONST IAPPFILES = 1
CONST ILIBRARIES = 2
CONST IMODELS = 3
CONST ITEXTURES = 4
CONST IBTEXTURES = 5
CONST N_CHECKBOXES = 5 '' you get this from counting the number of
'' checkboxes in dialog #6200
GLOBAL DESTDIRNAME$ '' the path of the destination directory
GLOBAL PRODUCTNAME$ '' the real name of the product (like "Virtus VR")
GLOBAL EXEFILENAME$ '' the name of the exe (like VIRTUSVR.EXE)
GLOBAL PROGRAMGROUP$ '' name we want the group to have in the Program Manager
GLOBAL DATAFILEEXT$ '' file extension for the models (VVR, WLK)
GLOBAL INFFILENAME$ '' name of the INF file
GLOBAL DEFDIRNAME$ '' default directory name
GLOBAL THEINIFILE$ '' name of the ini file we associate our extension in
GLOBAL BACKUPINIFILE$ '' name we back the ini file up to
GLOBAL WINDRIVE$ '' windows drive (the windows dir is here)
GLOBAL WINDIR$
GLOBAL DIALOGDLL$ '' where the dialogs come from
''DECLARE SUB VL_Initialize
'-------------------------------------------------------------------
' inits the variables specific to this installer.
SUB VL_Initialize STATIC
WINDIR$ = GetWindowsDir()
WINDRIVE$ = ucase$(MID$(WINDIR$, 1, 1))
'' REPLACE ME!
PRODUCTNAME$ = "Key Design Center 3D"
EXEFILENAME$ = "DESIGN3D.EXE"
PROGRAMGROUP$ = "Key Design Center 3D"
DATAFILEEXT$ = "VVR"
INFFILENAME$ = "DESIGN3D.INF"
DEFDIRNAME$ = "DESIGN3D"
BACKUPINIFILE$ = "winini.dc3"
'' REPLACE ME!
DESTDIRNAME$ = WINDRIVE$ + ":\" + DEFDIRNAME$
THEINIFILE$ = "win.ini"
DIALOGDLL$ = "mscuistf.dll"
END SUB
'*******************************************************************
' Variable and functions for the disk cost stuff. There is one
' variable for each section in the dialog #6200. Also related are
' the I* constants in the previous section
''CustInst list symbol names
GLOBAL APPNEEDS$ 'Application items need this much disk space
GLOBAL LIBRARYNEEDS$ 'Gallery items need
GLOBAL MODELNEEDS$ 'Scene items need this much disk space
GLOBAL TEXTURENEEDS$ 'Texture items need this much disk space
GLOBAL BTEXTURENEEDS$ 'Texture items need this much disk space
GLOBAL EXTRACOSTS$ 'List of extra costs to add per drive. This is how much we're short.
''DECLARE SUB VL_InitDiskCosts
''DECLARE SUB VL_RecalcOptFiles (ftype%)
''DECLARE FUNCTION VL_DoCheckItems(pItem$) AS INTEGER
''DECLARE FUNCTION VL_CalcDiskCost(pDrive$) AS LONG
'-------------------------------------------------------------------
' inits the variables specific to calculating the disk costs
SUB VL_InitDiskCosts STATIC
''Disk cost list symbols
'' REPLACE ME!
APPNEEDS$ = "AppNeeds"
LIBRARYNEEDS$ = "LibraryNeeds"
MODELNEEDS$ = "ModelNeeds"
TEXTURENEEDS$ = "TextureNeeds"
BTEXTURENEEDS$ = "BTextureNeeds"
'' REPLACE ME!
EXTRACOSTS$ = "ExtraCosts"
FOR i% = 1 TO 26 STEP 1
AddListItem APPNEEDS$, "0"
AddListItem LIBRARYNEEDS$, "0"
AddListItem MODELNEEDS$, "0"
AddListItem TEXTURENEEDS$, "0"
AddListItem BTEXTURENEEDS$, "0"
AddListItem EXTRACOSTS$, "0"
NEXT i%
END SUB
'-------------------------------------------------------------------
' calculates disk cost
SUB VL_RecalcOptFiles (ftype%) STATIC
CursorSave% = ShowWaitCursor()
ClearCopyList
VL_AddOptFilesToCopyList ftype%
fExtra% = 0
ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
IF ftype% = IAPPFILES THEN
'$IFDEF PROGRAM
IF GetListItem(CHECKSTATES$, IAPPFILES) = "ON" THEN
''Add extra cost to Windows drive for ini/progman, etc.
ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
fExtra% = 1
END IF
'$ENDIF 'PROGRAM
ListSym$ = APPNEEDS$
ELSEIF ftype% = ILIBRARIES THEN
ListSym$ = LIBRARYNEEDS$
ELSEIF ftype% = IMODELS THEN
ListSym$ = MODELNEEDS$
ELSEIF ftype% = ITEXTURES THEN
ListSym$ = TEXTURENEEDS$
ELSEIF ftype% = IBTEXTURES THEN
ListSym$ = BTEXTURENEEDS$
ELSE
ListSym$ = ""
END IF
StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
cost& = 0
FOR i% = 1 TO 26 STEP 1
cost& = cost& + VAL(GetListItem(ListSym$, i%))
NEXT i%
ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
IF fExtra% THEN
ReplaceListItem EXTRACOSTS$, ndrive%, "0"
END IF
RestoreCursor CursorSave%
ListSym$ = ""
END SUB
'-------------------------------------------------------------------
' handles the custom install (dialog #6200) checkboxes. Order is
' set in the dialog itself.
FUNCTION VL_DoCheckItems(pItem$) STATIC AS INTEGER
IF pItem$ = "CHK1" THEN
VL_RecalcOptFiles IAPPFILES
ok% = 1
ELSEIF pItem$ = "CHK2" THEN
VL_RecalcOptFiles ILIBRARIES
ok% = 1
ELSEIF pItem$ = "CHK3" THEN
VL_RecalcOptFiles IMODELS
ok% = 1
ELSEIF pItem$ = "CHK4" THEN
VL_RecalcOptFiles ITEXTURES
ok% = 1
ELSEIF pItem$ = "CHK5" THEN
VL_RecalcOptFiles IBTEXTURES
ok% = 1
ELSE
ok% = 0
END IF
VL_DoCheckItems = ok%
END FUNCTION
'-------------------------------------------------------------------
' Calculates the cost of installing the items in the list by adding
' the cost associated with each of the items.
FUNCTION VL_CalcDiskCost (pDrive$) STATIC AS LONG
'$ifdef DEBUG
if pDrive$ = "" then
BadArgErr 1, "VL_CalcDiskCost", pDrive$
end if
'$endif ''DEBUG
ndrive% = ASC(ucase$(pDrive$)) - ASC("A") + 1
diskCost& = 0
''REPLACE ME BEGIN
diskCost& = diskCost& + VAL(GetListItem(APPNEEDS$, ndrive%))
diskCost& = diskCost& + VAL(GetListItem(LIBRARYNEEDS$, ndrive%))
diskCost& = diskCost& + VAL(GetListItem(MODELNEEDS$, ndrive%))
diskCost& = diskCost& + VAL(GetListItem(TEXTURENEEDS$, ndrive%))
diskCost& = diskCost& + VAL(GetListItem(BTEXTURENEEDS$, ndrive%))
''REPLACE ME END
VL_CalcDiskCost = diskCost&
END FUNCTION
SUB VL_SetupBillboards STATIC
ClearBillboardList
AddToBillboardList DIALOGDLL$, 110, "FModelessDlgProc", 40
AddToBillboardList DIALOGDLL$, 111, "FModelessDlgProc", 40
AddToBillboardList DIALOGDLL$, 112, "FModelessDlgProc", 40
AddToBillboardList DIALOGDLL$, 115, "FModelessDlgProc", 10
AddToBillboardList DIALOGDLL$, 113, "FModelessDlgProc", 40
AddToBillboardList DIALOGDLL$, 114, "FModel